Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 7 - View-Related Objects / About View Device Objects


View Device Properties

View device objects have six accessible properties, as shown in Figure 7-12. Note that, because a view device is an object and not a data structure, the order of the properties as shown in Figure 7-12 is completely arbitrary. Properties in italics are references to other objects.

Figure 7-12 View device object properties

These are the accessible properties:

Note that QuickDraw GX sets the properties for all onscreen view devices (view device objects that represent physical display devices present on the user's system). You cannot change the properties of those view devices.

View Device Clip and Mapping

Like transforms and view ports, view device objects have a clip property and a mapping property. A view device's mapping and clip are applied to a shape after those of the transform and the view port have already been applied.

The clip and mapping properties for a view device follow the same general conventions as for transform objects. The clip property specifies a mask that restricts the area on the device in which drawing or printing takes place. The clip is equivalent to a primitive shape, a shape whose geometry and fill properties by themselves define the shape. Specifically, a clip can be a framed or filled geometric shape, a glyph shape, a 1-bit-per-pixel bitmap shape, or an empty or full shape. Primitive shapes are described in more detail in the geometric operations chapter of Inside Macintosh: QuickDraw GX Graphics.

The filled or framed parts of the clip define the areas in which drawing can occur. In most cases the view device clip is simply a filled rectangle, often covering exactly the imageable area of the device. You can, however, restrict drawing to a single portion of the device by making the clip shape smaller.

The mapping property of a view device is a 3 3 matrix that specifies one or more transformations that the view device applies to shapes drawn into it. You can use the view device mapping like other mappings, to perform translation, scaling, rotation, skewing, or perspective. However, in most cases the view device mapping is used only to position the view device relative to other view devices and view ports, and to define its pixel size (an identity mapping usually means that pixel size is 72 per inch). You normally do not need to modify a view device's mapping, although it is possible for view device objects that you create yourself.

View Device Bitmap

The bitmap property of a view device is stored as a bitmap structure (type gxBitmap) that represents the imaging area of the device. The bitmap specifies the height, width, and pixel depth of the view device. The upper left corner of the pixel image is the upper left corner of the imaging area of the device; if the view device object has an identity mapping, that also corresponds to location (0.0, 0.0) in the view group to which the view device belongs.

The bitmap also specifies, possibly by using a reference to a color set object, the color of each pixel and the set of available colors on the device. (Bitmaps with fewer than 16 bits per pixel must use a color set.) The bitmap may also include a reference to a color profile object that defines the color response characteristics of the device.

The end result of a drawing operation is the assignment of pixel values to the bitmap of a view device, followed by the transfer of those pixels to the screen or onto paper. In screen drawing or in printing, you can use transfer modes that either ignore or take into account the current pixel values of the bitmap, which themselves may be the products of previous drawing actions.

When you retrieve the bitmap property of a view device object, QuickDraw GX returns it to you as a bitmap shape that includes the information from the bitmap structure in the view device.

Bitmap shapes are described in the bitmap shapes chapter of Inside Macintosh: QuickDraw GX Graphics. Color set objects and color profile objects are described in
the chapter "Color and Color-Related Objects" in this book.

View Device Attributes

Each view device object has a set of attributes, a group of flags that influence device behavior. View device attributes allow you to make a device active or inactive, and to specify whether or not the pixel image needs to be stored in directly accessible memory. Table 7-3 lists the constants for the view device attributes and describes what each one means. The constants are defined in the gxDeviceAttributes enumeration.
View device attributes
ConstantValueExplanation
gxDirectDevice0x01If set, QuickDraw GX puts the pixel image of the view device's bitmap in directly accessible memory, if possible.
gxRemoteDevice0x02If set, QuickDraw GX puts the pixel image of the view device's bitmap in remote memory, such as on an accelerator card or video controller card, if possible.
gxInactiveDevice0x04If set, QuickDraw GX makes the device inactive, meaning that no drawing occurs on it. As an object, however, the device retains its existence and all its properties. QuickDraw GX sets this attribute for view device objects whose GDevice records mark them as inactive Macintosh graphics devices. The relation of graphics devices to view devices is described in the Macintosh environment chapter of Inside Macintosh: QuickDraw GX Environment and Utilities; the GDevice record itself is described in Inside Macintosh: Imaging with QuickDraw.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996